﻿<!--#include file="../lib/base.asp"-->
<!--#include file="../theme.asp"-->
<%
sdcms.checkuserlogin
dim act:act=lcase(sdcms.fget("act",0))
dim msg:msg=sdcms.fget("msg",0)
select case act
	case "checkdb":checkdb()
	case else
		sdcms.show theme_userbrand,""
end select

sub checkdb()
	dim t0,t1,t2,t3,t4
	t0=sdcms.enhtml(sdcms.fpost("my_Branden",0))
	t1=sdcms.enhtml(sdcms.fpost("my_Brandurl",0))
	t2=sdcms.enhtml(sdcms.fpost("my_Brandintro",0))
	t3=sdcms.enhtml(sdcms.fpost("my_Brandlogo",0))
	t4=sdcms.enhtml(sdcms.fpost("my_Brand",0))
	if not(sdcms.checkpost) then
		sdcms.ajaxjson "禁止外部提交数据",0
		exit sub
	end if
	if sdcms.strlen(t0)=0 then
		sdcms.ajaxjson "品牌英文名称不能为空",0
		exit sub
	end if
	if sdcms.strlen(t3)=0 then
		sdcms.ajaxjson "品牌logo不能为空",0
		exit sub
	end if
	if sdcms.strlen(t4)=0 then
		sdcms.ajaxjson "品牌中文名称不能为空",0
		exit sub
	end if
	dim userdata:userdata=sdcms.userinfo
	sdcms.db.dbupdate "sd_user","id="&userdata(0)&"",array(array("my_Branden",t0,255,1),array("my_Brandurl",t1,255,1),array("my_Brandintro",t2,0,1),array("my_Brandlogo",t3,255,1),array("my_Brand",t4,255,1))
	sdcms.resetuserinfo "u.id="&userdata(0)&""
	sdcms.ajaxjson "修改成功",1
end sub
sdcms.db.dbclose
%>